//
//  DownLoadCountryList.m
//  TravelWorld
//
//  Created by dllo on 15/5/22.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DownLoadCountryList.h"

@implementation DownLoadCountryList
+ (void)downLoadCountryList:(NSDictionary *)parameters{
    
    AFHTTPRequestOperationManager *mannager = [AFHTTPRequestOperationManager manager];
    
    [mannager.responseSerializer setAcceptableContentTypes: [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html",@"text/css", nil]];
    
    [mannager GET:[InterFaceURL getCountryListURL] parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:operation.responseData options:NSJSONReadingMutableContainers error:NULL];
//        NSLog(@"%@", dic);
        NSArray *arr = [AnalysisCountryList AnalysisContinentList:dic];
        
        
//        发送解析后的数组
        [[NSNotificationCenter defaultCenter] postNotificationName:@"countryList" object:arr userInfo:nil];
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
}
@end
